from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from options import options
from service import service



url=r"http://192.168.4.6/upload/"
dr=webdriver.Chrome(options=options,service=service)
# 打开论坛
dr.get(url)
dr.maximize_window()
sleep(3)
# 登录
# 输入用户名
dr.find_element(By.ID,'ls_username').clear()
dr.find_element(By.ID,'ls_username').send_keys('admin')
sleep(2)
# 输入密码
dr.find_element(By.ID,'ls_password').clear()
dr.find_element(By.ID,'ls_password').send_keys('root')
sleep(2)
# 点击登录
dr.find_element(By.XPATH,'//*[@id="lsform"]/div/div/table/tbody/tr[2]/td[3]/button/em').click()
sleep(2)
# 点击退出
dr.find_element(By.LINK_TEXT,'退出').click()
sleep(3)


